                            2     	      Name

    blend_minmax

Name Strings

    ARB_imaging

Version

    $Date: 1997/09/22 23:03:25 $ $Revision: 1.1 $

Dependencies

    OpenGL 1.2 is required

Overview

    Blending capability is extended by respecifying the entire blend
    equation. While this document defines only two new equations, the
    BlendEquation procedure that it defines may be used by to define
    additional blending equations.

    The two new equations defined by this extension produce the minimum (or
    maximum) color components of the source and destination colors. Taking
    the maximum is useful for applications such as maximum projection in
    medical imaging.

Issues

    *	I've prefixed the ADD token with FUNC, to indicate that the blend
	equation includes the parameters specified by BlendFunc.  (The min
	and max equations don't.)  Is this necessary?  Is it too ugly?
	Is there a better way to accomplish the same thing?

New Procedures and Functions

    void BlendEquation(enum mode);

New Tokens

    Accepted by the <mode> parameter of BlendEquation:

	FUNC_ADD		    0x8006
	MIN			    0x8007
	MAX			    0x8008

    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
    GetFloatv, and GetDoublev:

	BLEND_EQUATION		    0x8009

Additions to Chapter 2 of the GL Specification (OpenGL Operation)

    None

Additions to Chapter 3 of the GL Specification (Rasterization)

    None

Additions to Chapter 4 of the GL Specification (Per-Fragment Operations
and the Framebuffer)

    The GL Specification defines a single blending equation.  This
    extension introduces a blend equation mode that is specified by calling
    BlendEquation with one of three enumerated values.	The default
    value FUNC_ADD specifies that the blending equation defined in
    the GL Specification be used.  This equation is

	C' = (Cs * S) + (Cd * D)

	     /	1.0	C' > 1.0
	C = (
	     \	 C'	C' <= 1.0

    where Cs and Cd are the source and destination colors, and S and D are
    as specified by BlendFunc.

    If BlendEquation is called with <mode> set to MIN, the
    blending equation becomes

	C = min (Cs, Cd)

    Finally, if BlendEquation is called with <mode> set to MAX, the
    blending equation becomes

	C = max (Cs, Cd)

    In all cases the blending equation is evaluated separately for each
    color component.

Additions to Chapter 5 of the GL Specification (Special Functions)

    None

Additions to Chapter 6 of the GL Specification (State and State Requests)

    None

Additions to the GLX Specification

    None

GLX Protocol

    A new GL rendering command is added. The following command is sent to the
    server as part of a glXRender request:

	BlendEquation
	    2		8		rendering command length
	    2		4097		rendering command opcode
	    4		ENUM		mode

Errors

    INVALID_ENUM is generated by BlendEquation if its single parameter
    is not FUNC_ADD, MIN, or MAX.

    INVALID_OPERATION is generated if BlendEquation is executed between
    the execution of Begin and the corresponding execution to End.

New State

    Get Value		Get Command	Type	Initial Value	Attribute
    ---------		-----------	----	-------------	---------
    BLEND_EQUATION	GetIntegerv	Z3	FUNC_ADD	color-buffer

New Implementation Dependent State

    None
TEXTMOSS                  